#!/bin/bash

echo "快速解决网络冲突..."
echo

# 停止容器
echo "1. 停止容器..."
docker-compose -f docker-compose.lightweight.yml down 2>/dev/null || true
docker-compose down 2>/dev/null || true

# 删除冲突网络
echo "2. 删除冲突网络..."
docker network rm ubuntu-desktop_desktop-network 2>/dev/null || true
docker network rm ubuntu-desktop_desktop-network-lightweight 2>/dev/null || true
docker network rm ubuntu-desktop_desktop-network-standard 2>/dev/null || true

# 清理网络
echo "3. 清理网络..."
docker network prune -f

echo
echo "网络冲突已解决！"
echo "现在可以重新启动服务："
echo "  docker-compose -f docker-compose.lightweight.yml up -d"
echo 